package com.zking.service.hcy;

import com.zking.entity.Item;
import com.zking.entity.Seller;
import com.zking.mapper.SellerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SellerService {

    @Autowired
    private SellerMapper sellerMapper;

    public Seller querySellers(String sellerId){
        return sellerMapper.querySellers(sellerId);
    }
    public List<Seller> querySellers(){
        return sellerMapper.selectSellerAll();
    }

    public Boolean addSeller(Seller seller) {
        return sellerMapper.insert(seller) > 0;
    }

    public Seller querySellerBySellerId(String sellerId) {
        return sellerMapper.querySellerBySellerId(sellerId);
    }

    public boolean updateSeller(String sellerId, String name2,  String telephone4,
                                String addressDetail2, String linkmanName2, String linkmanQq2, String linkmanMobile2,
                                String linkmanEmail2, String licenseNumber2, String taxNumber2, String orgNumber2,
                                String legalPerson2, String legalPersonCardId2, String bankUser2, String bankName2,
                                String bankAccount2) {
        return sellerMapper.updateSeller(sellerId, name2, telephone4,addressDetail2,linkmanName2
                ,linkmanQq2,linkmanMobile2,linkmanEmail2,licenseNumber2,taxNumber2,orgNumber2,legalPerson2
                ,legalPersonCardId2,bankUser2,bankName2,bankAccount2) > 0;
    }

}
